package com.qding.park.manager.service.core.biz;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;

import com.qding.park.common.core.constant.MongodbConstant;
import com.qding.park.manager.cache.ParkCacheInter;
import com.qding.park.manager.pojo.TbCar;
import com.qding.park.manager.pojo.TbHistoryRecord;
import com.qding.park.manager.service.core.mapper.TbCarMapper;

/**
 * @author Administrator
 *线下业务
 */
@Component("outLineBiz")
public class OutLineBiz {
	
	private static final Log _log = LogFactory.getLog(OutLineBiz.class);
	
	@Autowired
	private MongoTemplate mongoTemplate;
	
	@Autowired
	private  TbCarMapper  tbCarMapper;
	
	@Autowired
	private ParkCacheInter parkCacheInter;
	
	public List<TbHistoryRecord> tempRecordList(int userId,int jumpPage,int pageLength){
		
		List<TbCar> cars= tbCarMapper.queryMyCars(userId);
		
		String tablename_tempPay = MongodbConstant.TABLENAME_TEMPPAY;
		Criteria matchCrieria = new Criteria();
		
		for(TbCar car:cars){
			String carNum=car.getCarNum();
			int parkId=car.getParkID();
			
			Criteria orCrieria=new Criteria();
			
			orCrieria.andOperator(Criteria.where("parkId").is(parkId),Criteria.where("carNum").is(carNum));
			
			matchCrieria.orOperator(orCrieria);
		}
		
		_log.info(matchCrieria);
		
		Query query=Query.query(matchCrieria);
		return null;
	}

}
